<template>
  <view>
    <view class="BigBox">
      <view>
        <image :src="narUrl" mode="widthFix"  class="narImg"></image>
      </view>
    </view>
    <view class="footer">
      <image :src="footerUrl" mode="widthFix"  class="footerImg"></image>
    </view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        author:'小新',
        // goodName:'数字媒体CD',
        // price:'￥1000',
        narUrl: '',
        footerUrl:''
      };
    },
    onLoad(options) {
      console.log(options);
      if (options.price === undefined) {
        return
      }
      this.author = options.author;
      this.getSwiper()
      // this.goodName = options.goodName;
      // this.price = '￥' + options.price
    },
    methods: {
      async getSwiper() {
        console.log(this.author);
        const res  = await uni.$http.post('/goods-detail/select?author='+ this.author)
        // console.log(res.data.data[0]);
        console.log(res.data);
        if(res.code !== 200) {
          console.log("错误");
        }

        this.narUrl = res.data.data[0].photo
        this.footerUrl = res.data.data[1].photo
        // this.swiperList = res.data
      },
    }
  }
</script>

<style lang="scss">
  .BigBox {
    width: 100%;
    height: 100%;
    background-color: #1a232c;
    // text-align: center;
    .narImg {
      width: 100%;
    }
  }
  .footer {
    // 设置定位效果为“吸顶”
    position: sticky;
    // 吸顶的“位置”
    bottom: 0;
    // 提高层级，防止被轮播图覆盖
    z-index: 999;
    height: 118rpx;
    // background-color: aqua;
    background-color: #253143;
    justify-content: center;
    align-items: center;
    .footerImg {
      width: 100%;
    }

  }
</style>
